package com.cbts.entity;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * ApplayReim entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "applay_reim", catalog = "cbts")
public class ApplayReim implements java.io.Serializable {

	// Fields

	private String travelOrder;
	private UserInfo userInfo;
	private BusinessTravelList businessTravelList;
	private Date applayTime;
	private Double appAmount;
	private Double amount;
	private Double saveCost;
	private String applayFileId;
	private Double realAppAmount;

	// Constructors

	/** default constructor */
	public ApplayReim() {
		appAmount=0.00;
		amount=0.00;
		saveCost=0.00;
		realAppAmount=0.00;
	}

	/** minimal constructor */
	public ApplayReim(String travelOrder, UserInfo userInfo,
			BusinessTravelList businessTravelList, Date applayTime,
			Double appAmount, Double amount, Double saveCost,
			Double realAppAmount) {
		this.travelOrder = travelOrder;
		this.userInfo = userInfo;
		this.businessTravelList = businessTravelList;
		this.applayTime = applayTime;
		this.appAmount = appAmount;
		this.amount = amount;
		this.saveCost = saveCost;
		this.realAppAmount = realAppAmount;
	}

	/** full constructor */
	public ApplayReim(String travelOrder, UserInfo userInfo,
			BusinessTravelList businessTravelList, Date applayTime,
			Double appAmount, Double amount, Double saveCost,
			String applayFileId, Double realAppAmount) {
		this.travelOrder = travelOrder;
		this.userInfo = userInfo;
		this.businessTravelList = businessTravelList;
		this.applayTime = applayTime;
		this.appAmount = appAmount;
		this.amount = amount;
		this.saveCost = saveCost;
		this.applayFileId = applayFileId;
		this.realAppAmount = realAppAmount;
	}

	// Property accessors
	@Id
	@Column(name = "travelOrder", unique = true, nullable = false, length = 26)
	public String getTravelOrder() {
		return this.travelOrder;
	}

	public void setTravelOrder(String travelOrder) {
		this.travelOrder = travelOrder;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "userid", nullable = false)
	public UserInfo getUserInfo() {
		return this.userInfo;
	}

	public void setUserInfo(UserInfo userInfo) {
		this.userInfo = userInfo;
	}

	@OneToOne(fetch = FetchType.LAZY)
	@PrimaryKeyJoinColumn
	public BusinessTravelList getBusinessTravelList() {
		return this.businessTravelList;
	}

	public void setBusinessTravelList(BusinessTravelList businessTravelList) {
		this.businessTravelList = businessTravelList;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "applayTime", nullable = false, length = 10)
	public Date getApplayTime() {
		return this.applayTime;
	}

	public void setApplayTime(Date applayTime) {
		this.applayTime = new Date(applayTime.getTime());
	}

	@Column(name = "appAmount", nullable = false, precision = 11)
	public Double getAppAmount() {
		return this.appAmount;
	}

	public void setAppAmount(Double appAmount) {
		this.appAmount = appAmount;
	}

	@Column(name = "amount", nullable = false, precision = 11)
	public Double getAmount() {
		return this.amount;
	}

	public void setAmount(Double amount) {
		this.amount = amount;
	}

	@Column(name = "saveCost", nullable = false, precision = 11)
	public Double getSaveCost() {
		return this.saveCost;
	}

	public void setSaveCost(Double saveCost) {
		this.saveCost = saveCost;
	}

	@Column(name = "applayFileId", length = 26)
	public String getApplayFileId() {
		return this.applayFileId;
	}

	public void setApplayFileId(String applayFileId) {
		this.applayFileId = applayFileId;
	}

	@Column(name = "realAppAmount", nullable = false, precision = 11)
	public Double getRealAppAmount() {
		return this.realAppAmount;
	}

	public void setRealAppAmount(Double realAppAmount) {
		this.realAppAmount = realAppAmount;
	}

}